package week7;
public class Person2 implements Cloneable {
    private String name;
    private int ID;
    Person2(String name, int ID){
        this.name = name;
        this.ID = ID;
    }
    public String getName() {
        return name;
    }
    public int getID() {
        return ID;
    }
    @Override
    protected Person2 clone() throws CloneNotSupportedException {
        return (Person2)super.clone();
    }

    public static void main(String[] args) {
        try {
            Person2 p = new Person2("Justin",20150001);
            Person2 p2 = p.clone();

            System.out.println(p);
            System.out.println(p2);
        }catch(CloneNotSupportedException e){
            System.out.println(e);
        }
    }
}
